<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# OPTIONS_HADDOCK not-home #-}</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 701
</span><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE DeriveGeneric #-}</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-7"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Module      :  Text.PrettyPrint.HughesPJ</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow 2001</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- License     :  BSD-style (see the file LICENSE)</span><span>
</span><span id="line-12"></span><span class="hs-comment">--</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Maintainer  :  David Terei &lt;code@davidterei.com&gt;</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Stability   :  stable</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-16"></span><span class="hs-comment">--</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- Provides a collection of pretty printer combinators, a set of API's that</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- provides a way to easily print out text in a consistent format of your</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- choosing.</span><span>
</span><span id="line-20"></span><span class="hs-comment">--</span><span>
</span><span id="line-21"></span><span class="hs-comment">-- Originally designed by John Hughes's and Simon Peyton Jones's.</span><span>
</span><span id="line-22"></span><span class="hs-comment">--</span><span>
</span><span id="line-23"></span><span class="hs-comment">-- For more information you can refer to the</span><span>
</span><span id="line-24"></span><span class="hs-comment">-- &lt;http://belle.sourceforge.net/doc/hughes95design.pdf original paper&gt; that</span><span>
</span><span id="line-25"></span><span class="hs-comment">-- serves as the basis for this libraries design: /The Design of a</span><span>
</span><span id="line-26"></span><span class="hs-comment">-- Pretty-printing Library/ by John Hughes, in Advanced Functional Programming,</span><span>
</span><span id="line-27"></span><span class="hs-comment">-- 1995.</span><span>
</span><span id="line-28"></span><span class="hs-comment">--</span><span>
</span><span id="line-29"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span class="hs-cpp">

#ifndef TESTING
</span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Text.PrettyPrint.HughesPJ</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span>        </span><span class="annot"><span class="hs-comment">-- * The document type</span></span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier">Doc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextDetails"><span class="hs-identifier">TextDetails</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Constructing documents</span></span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Converting values into documents</span></span><span>
</span><span id="line-40"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier">char</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#text"><span class="hs-identifier">text</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#ptext"><span class="hs-identifier">ptext</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#sizedText"><span class="hs-identifier">sizedText</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#zeroWidthText"><span class="hs-identifier">zeroWidthText</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#int"><span class="hs-identifier">int</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#integer"><span class="hs-identifier">integer</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#float"><span class="hs-identifier">float</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#double"><span class="hs-identifier">double</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#rational"><span class="hs-identifier">rational</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Simple derived documents</span></span><span>
</span><span id="line-44"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#semi"><span class="hs-identifier">semi</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#comma"><span class="hs-identifier">comma</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#colon"><span class="hs-identifier">colon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#space"><span class="hs-identifier">space</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#equals"><span class="hs-identifier">equals</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-45"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#lparen"><span class="hs-identifier">lparen</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#rparen"><span class="hs-identifier">rparen</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#lbrack"><span class="hs-identifier">lbrack</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#rbrack"><span class="hs-identifier">rbrack</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#lbrace"><span class="hs-identifier">lbrace</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#rbrace"><span class="hs-identifier">rbrace</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Wrapping documents in delimiters</span></span><span>
</span><span id="line-48"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#parens"><span class="hs-identifier">parens</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#brackets"><span class="hs-identifier">brackets</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#braces"><span class="hs-identifier">braces</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#quotes"><span class="hs-identifier">quotes</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#doubleQuotes"><span class="hs-identifier">doubleQuotes</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#maybeParens"><span class="hs-identifier">maybeParens</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#maybeBrackets"><span class="hs-identifier">maybeBrackets</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#maybeBraces"><span class="hs-identifier">maybeBraces</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#maybeQuotes"><span class="hs-identifier">maybeQuotes</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#maybeDoubleQuotes"><span class="hs-identifier">maybeDoubleQuotes</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Combining documents</span></span><span>
</span><span id="line-52"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#empty"><span class="hs-identifier">empty</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-53"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#%3C%3E"><span class="hs-operator">(&lt;&gt;)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#%3C%2B%3E"><span class="hs-operator">(&lt;+&gt;)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#hcat"><span class="hs-identifier">hcat</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#hsep"><span class="hs-identifier">hsep</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-54"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#%24%24"><span class="hs-operator">($$)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#%24%2B%24"><span class="hs-operator">($+$)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#vcat"><span class="hs-identifier">vcat</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-55"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#sep"><span class="hs-identifier">sep</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#cat"><span class="hs-identifier">cat</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-56"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#fsep"><span class="hs-identifier">fsep</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#fcat"><span class="hs-identifier">fcat</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-57"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#nest"><span class="hs-identifier">nest</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-58"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#hang"><span class="hs-identifier">hang</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#punctuate"><span class="hs-identifier">punctuate</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Predicates on documents</span></span><span>
</span><span id="line-61"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#isEmpty"><span class="hs-identifier">isEmpty</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-62"></span><span>
</span><span id="line-63"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Utility functions for documents</span></span><span>
</span><span id="line-64"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#first"><span class="hs-identifier">first</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#reduceDoc"><span class="hs-identifier">reduceDoc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-65"></span><span>
</span><span id="line-66"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Rendering documents</span></span><span>
</span><span id="line-67"></span><span>
</span><span id="line-68"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Default rendering</span></span><span>
</span><span id="line-69"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#render"><span class="hs-identifier">render</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Rendering with a particular style</span></span><span>
</span><span id="line-72"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Style"><span class="hs-identifier">Style</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-73"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier">style</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-74"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#renderStyle"><span class="hs-identifier">renderStyle</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-75"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Mode"><span class="hs-identifier">Mode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-76"></span><span>
</span><span id="line-77"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** General rendering</span></span><span>
</span><span id="line-78"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#fullRender"><span class="hs-identifier">fullRender</span></a></span><span>
</span><span id="line-79"></span><span>
</span><span id="line-80"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-83"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html"><span class="hs-identifier">Text.PrettyPrint.Annotated.HughesPJ</span></a></span><span>
</span><span id="line-84"></span><span>                     </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextDetails"><span class="hs-identifier">TextDetails</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Mode"><span class="hs-identifier">Mode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Style"><span class="hs-identifier">Style</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier">style</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-85"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html"><span class="hs-identifier">Text.PrettyPrint.Annotated.HughesPJ</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Ann</span></span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#"><span class="hs-identifier">Control.DeepSeq</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#NFData"><span class="hs-identifier">NFData</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier">rnf</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-88"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Function.html#"><span class="hs-identifier">Data.Function</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Function.html#on"><span class="hs-identifier">on</span></a></span><span> </span><span class="hs-special">)</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 803
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span>         </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator">(&lt;&gt;)</span></a></span><span> </span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">#if __GLASGOW_HASKELL__ &gt;= 800
</span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.html#"><span class="hs-identifier">Data.Semigroup</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Semi</span></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier">Semigroup</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator">(&lt;&gt;)</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span class="hs-cpp">
#elif __GLASGOW_HASKELL__ &lt; 709
</span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data.Monoid</span><span>     </span><span class="hs-special">(</span><span> </span><span class="hs-identifier">Monoid</span><span class="hs-special">(</span><span class="hs-identifier">mempty</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">mappend</span><span class="hs-special">)</span><span>  </span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.String.html#"><span class="hs-identifier">Data.String</span></a></span><span>     </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.String.html#IsString"><span class="hs-identifier">IsString</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.String.html#fromString"><span class="hs-identifier">fromString</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.Generics.html#"><span class="hs-identifier">GHC.Generics</span></a></span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span>
</span><span id="line-102"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-103"></span><span class="hs-comment">-- Operator fixity</span><span>
</span><span id="line-104"></span><span>
</span><span id="line-105"></span><span class="hs-keyword">infixl</span><span> </span><span class="hs-number">6</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#%3C%3E"><span class="hs-operator hs-type">&lt;&gt;</span></a></span><span>
</span><span id="line-106"></span><span class="hs-keyword">infixl</span><span> </span><span class="hs-number">6</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#%3C%2B%3E"><span class="hs-operator hs-type">&lt;+&gt;</span></a></span><span>
</span><span id="line-107"></span><span class="hs-keyword">infixl</span><span> </span><span class="hs-number">5</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#%24%24"><span class="hs-operator hs-type">$$</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#%24%2B%24"><span class="hs-operator hs-type">$+$</span></a></span><span>
</span><span id="line-108"></span><span>
</span><span id="line-109"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-110"></span><span class="hs-comment">-- The Doc data type</span><span>
</span><span id="line-111"></span><span>
</span><span id="line-112"></span><span class="hs-comment">-- | The abstract type of documents. A Doc represents a /set/ of layouts. A</span><span>
</span><span id="line-113"></span><span class="hs-comment">-- Doc with no occurrences of Union or NoDoc represents just one layout.</span><span>
</span><span id="line-114"></span><span id="local-6989586621679050121"><span id="local-6989586621679050122"></span></span><span class="hs-keyword">newtype</span><span> </span><span id="Doc"><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-var">Doc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Doc"><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-var">Doc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Ann.Doc</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 701
</span><span>                    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall x. Doc -&gt; Rep Doc x)
-&gt; (forall x. Rep Doc x -&gt; Doc) -&gt; Generic Doc
forall x. Rep Doc x -&gt; Doc
forall x. Doc -&gt; Rep Doc x
forall a.
(forall x. a -&gt; Rep a x) -&gt; (forall x. Rep a x -&gt; a) -&gt; Generic a
$cto :: forall x. Rep Doc x -&gt; Doc
$cfrom :: forall x. Doc -&gt; Rep Doc x
</span><a href="../../base/src/GHC.Generics.html#Generic"><span class="hs-identifier hs-var hs-var hs-var hs-var">Generic</span></a></span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-119"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#liftList"><span class="hs-identifier hs-type">liftList</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Ann.Doc</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Ann.Doc</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-120"></span><span id="liftList"><span class="annot"><span class="annottext">liftList :: ([Doc ()] -&gt; Doc ()) -&gt; [Doc] -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#liftList"><span class="hs-identifier hs-var hs-var">liftList</span></a></span></span><span> </span><span id="local-6989586621679050114"><span class="annot"><span class="annottext">[Doc ()] -&gt; Doc ()
</span><a href="#local-6989586621679050114"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679050113"><span class="annot"><span class="annottext">[Doc]
</span><a href="#local-6989586621679050113"><span class="hs-identifier hs-var">ds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-var">Doc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Doc ()] -&gt; Doc ()
</span><a href="#local-6989586621679050114"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050112"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span id="local-6989586621679050112"><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050112"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Doc]
</span><a href="#local-6989586621679050113"><span class="hs-identifier hs-var">ds</span></a></span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-121"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#liftList"><span class="hs-pragma hs-type">liftList</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-122"></span><span>
</span><span id="line-123"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#liftBinary"><span class="hs-identifier hs-type">liftBinary</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Ann.Doc</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Ann.Doc</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Ann.Doc</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-124"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span>    </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span>     </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span>     </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-125"></span><span id="liftBinary"><span class="annot"><span class="annottext">liftBinary :: (Doc () -&gt; Doc () -&gt; Doc ()) -&gt; Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#liftBinary"><span class="hs-identifier hs-var hs-var">liftBinary</span></a></span></span><span> </span><span id="local-6989586621679050110"><span class="annot"><span class="annottext">Doc () -&gt; Doc () -&gt; Doc ()
</span><a href="#local-6989586621679050110"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span id="local-6989586621679050109"><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050109"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span id="local-6989586621679050108"><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050108"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-var">Doc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc () -&gt; Doc () -&gt; Doc ()
</span><a href="#local-6989586621679050110"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050109"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050108"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-126"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#liftBinary"><span class="hs-pragma hs-type">liftBinary</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-127"></span><span>
</span><span id="line-128"></span><span class="hs-comment">-- | RDoc is a &quot;reduced GDoc&quot;, guaranteed not to have a top-level Above or</span><span>
</span><span id="line-129"></span><span class="hs-comment">-- Beside.</span><span>
</span><span id="line-130"></span><span class="hs-keyword">type</span><span> </span><span id="RDoc"><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#RDoc"><span class="hs-identifier hs-var">RDoc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span class="hs-comment">-- Combining @Doc@ values</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 800
</span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679050102"><span id="local-6989586621679050104"><span class="annot"><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semi.Semigroup</span></a></span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-135"></span><span>    </span><span id="local-6989586621679050100"><span class="annot"><span class="annottext">&lt;&gt; :: Doc -&gt; Doc -&gt; Doc
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">(Text.PrettyPrint.HughesPJ.&lt;&gt;)</span></a></span><span>
</span><span id="line-136"></span><span>
</span><span id="line-137"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679050094"><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-138"></span><span>    </span><span id="local-6989586621679050092"><span class="annot"><span class="annottext">mempty :: Doc
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-139"></span><span>    </span><span id="local-6989586621679050090"><span class="annot"><span class="annottext">mappend :: Doc -&gt; Doc -&gt; Doc
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var hs-var hs-var hs-var">mappend</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">(Semi.&lt;&gt;)</span></a></span><span class="hs-cpp">
#else
</span><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier">Monoid</span><span> </span><span class="hs-identifier">Doc</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-142"></span><span>    </span><span class="hs-identifier">mempty</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">empty</span><span>
</span><span id="line-143"></span><span>    </span><span class="hs-identifier">mappend</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-operator">&lt;&gt;</span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-146"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/Data.String.html#IsString"><span class="hs-identifier hs-type">IsString</span></a></span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-147"></span><span>    </span><span id="local-6989586621679050086"><span class="annot"><span class="annottext">fromString :: String -&gt; Doc
</span><a href="../../base/src/Data.String.html#fromString"><span class="hs-identifier hs-var hs-var hs-var hs-var">fromString</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#text"><span class="hs-identifier hs-var">text</span></a></span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679050081"><span id="local-6989586621679050083"><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-150"></span><span>  </span><span id="local-6989586621679050079"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; Doc -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#showsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679050077"><span class="annot"><span class="annottext">Doc
</span><a href="#local-6989586621679050077"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span id="local-6989586621679050076"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679050076"><span class="hs-identifier hs-var">cont</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mode
-&gt; Int
-&gt; Float
-&gt; (TextDetails -&gt; ShowS)
-&gt; String
-&gt; Doc
-&gt; String
forall a.
Mode -&gt; Int -&gt; Float -&gt; (TextDetails -&gt; a -&gt; a) -&gt; a -&gt; Doc -&gt; a
</span><a href="Text.PrettyPrint.HughesPJ.html#fullRender"><span class="hs-identifier hs-var">fullRender</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Mode
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mode"><span class="hs-identifier hs-var hs-var">mode</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lineLength"><span class="hs-identifier hs-var hs-var">lineLength</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-151"></span><span>                                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Float
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ribbonsPerLine"><span class="hs-identifier hs-var hs-var">ribbonsPerLine</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-152"></span><span>                                    </span><span class="annot"><span class="annottext">TextDetails -&gt; ShowS
</span><a href="Text.PrettyPrint.HughesPJ.html#txtPrinter"><span class="hs-identifier hs-var">txtPrinter</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679050076"><span class="hs-identifier hs-var">cont</span></a></span><span> </span><span class="annot"><span class="annottext">Doc
</span><a href="#local-6989586621679050077"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-153"></span><span>
</span><span id="line-154"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679050069"><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-type">Eq</span></a></span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-155"></span><span>  </span><span id="local-6989586621679050063"><span class="annot"><span class="annottext">== :: Doc -&gt; Doc -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">(==)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">(==)</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String -&gt; Bool) -&gt; (Doc -&gt; String) -&gt; Doc -&gt; Doc -&gt; Bool
forall b c a. (b -&gt; b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; c
</span><a href="../../base/src/Data.Function.html#on"><span class="hs-operator hs-var">`on`</span></a></span><span> </span><span class="annot"><span class="annottext">Doc -&gt; String
</span><a href="Text.PrettyPrint.HughesPJ.html#render"><span class="hs-identifier hs-var">render</span></a></span><span>
</span><span id="line-156"></span><span>
</span><span id="line-157"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#NFData"><span class="hs-identifier hs-type">NFData</span></a></span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-158"></span><span>  </span><span id="local-6989586621679050055"><span class="annot"><span class="annottext">rnf :: Doc -&gt; ()
</span><a href="#local-6989586621679050055"><span class="hs-identifier hs-var hs-var hs-var hs-var">rnf</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span id="local-6989586621679050054"><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050054"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050054"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-159"></span><span>
</span><span id="line-160"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-161"></span><span class="hs-comment">-- Values and Predicates on GDocs and TextDetails</span><span>
</span><span id="line-162"></span><span>
</span><span id="line-163"></span><span class="hs-comment">-- | A document of height and width 1, containing a literal character.</span><span>
</span><span id="line-164"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-type">char</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-165"></span><span id="char"><span class="annot"><span class="annottext">char :: Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var hs-var">char</span></a></span></span><span> </span><span id="local-6989586621679050053"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679050053"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-var">Doc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Doc ()
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">Ann.char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679050053"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-166"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-pragma hs-type">char</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-167"></span><span>
</span><span id="line-168"></span><span class="hs-comment">-- | A document of height 1 containing a literal string.</span><span>
</span><span id="line-169"></span><span class="hs-comment">-- 'text' satisfies the following laws:</span><span>
</span><span id="line-170"></span><span class="hs-comment">--</span><span>
</span><span id="line-171"></span><span class="hs-comment">-- * @'text' s '&lt;&gt;' 'text' t = 'text' (s'++'t)@</span><span>
</span><span id="line-172"></span><span class="hs-comment">--</span><span>
</span><span id="line-173"></span><span class="hs-comment">-- * @'text' \&quot;\&quot; '&lt;&gt;' x = x@, if @x@ non-empty</span><span>
</span><span id="line-174"></span><span class="hs-comment">--</span><span>
</span><span id="line-175"></span><span class="hs-comment">-- The side condition on the last law is necessary because @'text' \&quot;\&quot;@</span><span>
</span><span id="line-176"></span><span class="hs-comment">-- has height 1, while 'empty' has no height.</span><span>
</span><span id="line-177"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#text"><span class="hs-identifier hs-type">text</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-178"></span><span id="text"><span class="annot"><span class="annottext">text :: String -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#text"><span class="hs-identifier hs-var hs-var">text</span></a></span></span><span> </span><span id="local-6989586621679050051"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679050051"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-var">Doc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Doc ()
forall a. String -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#text"><span class="hs-identifier hs-var">Ann.text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679050051"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-179"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#text"><span class="hs-pragma hs-type">text</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-180"></span><span>
</span><span id="line-181"></span><span class="hs-comment">-- | Same as @text@. Used to be used for Bytestrings.</span><span>
</span><span id="line-182"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#ptext"><span class="hs-identifier hs-type">ptext</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-183"></span><span id="ptext"><span class="annot"><span class="annottext">ptext :: String -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#ptext"><span class="hs-identifier hs-var hs-var">ptext</span></a></span></span><span> </span><span id="local-6989586621679050049"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679050049"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-var">Doc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Doc ()
forall a. String -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ptext"><span class="hs-identifier hs-var">Ann.ptext</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679050049"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-184"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#ptext"><span class="hs-pragma hs-type">ptext</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-185"></span><span>
</span><span id="line-186"></span><span class="hs-comment">-- | Some text with any width. (@text s = sizedText (length s) s@)</span><span>
</span><span id="line-187"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#sizedText"><span class="hs-identifier hs-type">sizedText</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-188"></span><span id="sizedText"><span class="annot"><span class="annottext">sizedText :: Int -&gt; String -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#sizedText"><span class="hs-identifier hs-var hs-var">sizedText</span></a></span></span><span> </span><span id="local-6989586621679050047"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679050047"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679050046"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679050046"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-var">Doc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; String -&gt; Doc ()
forall a. Int -&gt; String -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sizedText"><span class="hs-identifier hs-var">Ann.sizedText</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679050047"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679050046"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-189"></span><span>
</span><span id="line-190"></span><span class="hs-comment">-- | Some text, but without any width. Use for non-printing text</span><span>
</span><span id="line-191"></span><span class="hs-comment">-- such as a HTML or Latex tags</span><span>
</span><span id="line-192"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#zeroWidthText"><span class="hs-identifier hs-type">zeroWidthText</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-193"></span><span id="zeroWidthText"><span class="annot"><span class="annottext">zeroWidthText :: String -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#zeroWidthText"><span class="hs-identifier hs-var hs-var">zeroWidthText</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; String -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#sizedText"><span class="hs-identifier hs-var">sizedText</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-194"></span><span>
</span><span id="line-195"></span><span class="hs-comment">-- | The empty document, with no height and no width.</span><span>
</span><span id="line-196"></span><span class="hs-comment">-- 'empty' is the identity for '&lt;&gt;', '&lt;+&gt;', '$$' and '$+$', and anywhere</span><span>
</span><span id="line-197"></span><span class="hs-comment">-- in the argument list for 'sep', 'hcat', 'hsep', 'vcat', 'fcat' etc.</span><span>
</span><span id="line-198"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#empty"><span class="hs-identifier hs-type">empty</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-199"></span><span id="empty"><span class="annot"><span class="annottext">empty :: Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#empty"><span class="hs-identifier hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-var">Doc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc ()
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#empty"><span class="hs-identifier hs-var">Ann.empty</span></a></span><span>
</span><span id="line-200"></span><span>
</span><span id="line-201"></span><span class="hs-comment">-- | Returns 'True' if the document is empty</span><span>
</span><span id="line-202"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#isEmpty"><span class="hs-identifier hs-type">isEmpty</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-203"></span><span id="isEmpty"><span class="annot"><span class="annottext">isEmpty :: Doc -&gt; Bool
</span><a href="Text.PrettyPrint.HughesPJ.html#isEmpty"><span class="hs-identifier hs-var hs-var">isEmpty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span id="local-6989586621679050043"><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050043"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; Bool
forall a. Doc a -&gt; Bool
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#isEmpty"><span class="hs-identifier hs-var">Ann.isEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050043"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-204"></span><span>
</span><span id="line-205"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#semi"><span class="hs-identifier hs-type">semi</span></a></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ A ';' character</span><span>
</span><span id="line-206"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#comma"><span class="hs-identifier hs-type">comma</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ A ',' character</span><span>
</span><span id="line-207"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#colon"><span class="hs-identifier hs-type">colon</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ A ':' character</span><span>
</span><span id="line-208"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#space"><span class="hs-identifier hs-type">space</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ A space character</span><span>
</span><span id="line-209"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#equals"><span class="hs-identifier hs-type">equals</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ A '=' character</span><span>
</span><span id="line-210"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#lparen"><span class="hs-identifier hs-type">lparen</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ A '(' character</span><span>
</span><span id="line-211"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#rparen"><span class="hs-identifier hs-type">rparen</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ A ')' character</span><span>
</span><span id="line-212"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#lbrack"><span class="hs-identifier hs-type">lbrack</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ A '[' character</span><span>
</span><span id="line-213"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#rbrack"><span class="hs-identifier hs-type">rbrack</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ A ']' character</span><span>
</span><span id="line-214"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#lbrace"><span class="hs-identifier hs-type">lbrace</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ A '{' character</span><span>
</span><span id="line-215"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#rbrace"><span class="hs-identifier hs-type">rbrace</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ A '}' character</span><span>
</span><span id="line-216"></span><span id="semi"><span class="annot"><span class="annottext">semi :: Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#semi"><span class="hs-identifier hs-var hs-var">semi</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">';'</span></span><span>
</span><span id="line-217"></span><span id="comma"><span class="annot"><span class="annottext">comma :: Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#comma"><span class="hs-identifier hs-var hs-var">comma</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">','</span></span><span>
</span><span id="line-218"></span><span id="colon"><span class="annot"><span class="annottext">colon :: Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#colon"><span class="hs-identifier hs-var hs-var">colon</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">':'</span></span><span>
</span><span id="line-219"></span><span id="space"><span class="annot"><span class="annottext">space :: Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#space"><span class="hs-identifier hs-var hs-var">space</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span>
</span><span id="line-220"></span><span id="equals"><span class="annot"><span class="annottext">equals :: Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#equals"><span class="hs-identifier hs-var hs-var">equals</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'='</span></span><span>
</span><span id="line-221"></span><span id="lparen"><span class="annot"><span class="annottext">lparen :: Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#lparen"><span class="hs-identifier hs-var hs-var">lparen</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'('</span></span><span>
</span><span id="line-222"></span><span id="rparen"><span class="annot"><span class="annottext">rparen :: Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#rparen"><span class="hs-identifier hs-var hs-var">rparen</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">')'</span></span><span>
</span><span id="line-223"></span><span id="lbrack"><span class="annot"><span class="annottext">lbrack :: Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#lbrack"><span class="hs-identifier hs-var hs-var">lbrack</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'['</span></span><span>
</span><span id="line-224"></span><span id="rbrack"><span class="annot"><span class="annottext">rbrack :: Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#rbrack"><span class="hs-identifier hs-var hs-var">rbrack</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">']'</span></span><span>
</span><span id="line-225"></span><span id="lbrace"><span class="annot"><span class="annottext">lbrace :: Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#lbrace"><span class="hs-identifier hs-var hs-var">lbrace</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'{'</span></span><span>
</span><span id="line-226"></span><span id="rbrace"><span class="annot"><span class="annottext">rbrace :: Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#rbrace"><span class="hs-identifier hs-var hs-var">rbrace</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'}'</span></span><span>
</span><span id="line-227"></span><span>
</span><span id="line-228"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#int"><span class="hs-identifier hs-type">int</span></a></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ @int n = text (show n)@</span><span>
</span><span id="line-229"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#integer"><span class="hs-identifier hs-type">integer</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ @integer n = text (show n)@</span><span>
</span><span id="line-230"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#float"><span class="hs-identifier hs-type">float</span></a></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Float"><span class="hs-identifier hs-type">Float</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ @float n = text (show n)@</span><span>
</span><span id="line-231"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#double"><span class="hs-identifier hs-type">double</span></a></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Double"><span class="hs-identifier hs-type">Double</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ @double n = text (show n)@</span><span>
</span><span id="line-232"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#rational"><span class="hs-identifier hs-type">rational</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Real.html#Rational"><span class="hs-identifier hs-type">Rational</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ @rational n = text (show n)@</span><span>
</span><span id="line-233"></span><span id="int"><span class="annot"><span class="annottext">int :: Int -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#int"><span class="hs-identifier hs-var hs-var">int</span></a></span></span><span>      </span><span id="local-6989586621679050041"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679050041"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679050041"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-234"></span><span id="integer"><span class="annot"><span class="annottext">integer :: Integer -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#integer"><span class="hs-identifier hs-var hs-var">integer</span></a></span></span><span>  </span><span id="local-6989586621679050039"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679050039"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679050039"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-235"></span><span id="float"><span class="annot"><span class="annottext">float :: Float -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#float"><span class="hs-identifier hs-var hs-var">float</span></a></span></span><span>    </span><span id="local-6989586621679050038"><span class="annot"><span class="annottext">Float
</span><a href="#local-6989586621679050038"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Float -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Float
</span><a href="#local-6989586621679050038"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-236"></span><span id="double"><span class="annot"><span class="annottext">double :: Double -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#double"><span class="hs-identifier hs-var hs-var">double</span></a></span></span><span>   </span><span id="local-6989586621679050037"><span class="annot"><span class="annottext">Double
</span><a href="#local-6989586621679050037"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Double -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Double
</span><a href="#local-6989586621679050037"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-237"></span><span id="rational"><span class="annot"><span class="annottext">rational :: Rational -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#rational"><span class="hs-identifier hs-var hs-var">rational</span></a></span></span><span> </span><span id="local-6989586621679050036"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621679050036"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621679050036"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-238"></span><span>
</span><span id="line-239"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#parens"><span class="hs-identifier hs-type">parens</span></a></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ Wrap document in @(...)@</span><span>
</span><span id="line-240"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#brackets"><span class="hs-identifier hs-type">brackets</span></a></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ Wrap document in @[...]@</span><span>
</span><span id="line-241"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#braces"><span class="hs-identifier hs-type">braces</span></a></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ Wrap document in @{...}@</span><span>
</span><span id="line-242"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#quotes"><span class="hs-identifier hs-type">quotes</span></a></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ Wrap document in @\'...\'@</span><span>
</span><span id="line-243"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#doubleQuotes"><span class="hs-identifier hs-type">doubleQuotes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-comment">-- ^ Wrap document in @\&quot;...\&quot;@</span><span>
</span><span id="line-244"></span><span id="quotes"><span class="annot"><span class="annottext">quotes :: Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#quotes"><span class="hs-identifier hs-var hs-var">quotes</span></a></span></span><span> </span><span id="local-6989586621679050035"><span class="annot"><span class="annottext">Doc
</span><a href="#local-6989586621679050035"><span class="hs-identifier hs-var">p</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\''</span></span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Doc
</span><a href="#local-6989586621679050035"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\''</span></span><span>
</span><span id="line-245"></span><span id="doubleQuotes"><span class="annot"><span class="annottext">doubleQuotes :: Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#doubleQuotes"><span class="hs-identifier hs-var hs-var">doubleQuotes</span></a></span></span><span> </span><span id="local-6989586621679050034"><span class="annot"><span class="annottext">Doc
</span><a href="#local-6989586621679050034"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'&quot;'</span></span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Doc
</span><a href="#local-6989586621679050034"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'&quot;'</span></span><span>
</span><span id="line-246"></span><span id="parens"><span class="annot"><span class="annottext">parens :: Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#parens"><span class="hs-identifier hs-var hs-var">parens</span></a></span></span><span> </span><span id="local-6989586621679050033"><span class="annot"><span class="annottext">Doc
</span><a href="#local-6989586621679050033"><span class="hs-identifier hs-var">p</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'('</span></span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Doc
</span><a href="#local-6989586621679050033"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">')'</span></span><span>
</span><span id="line-247"></span><span id="brackets"><span class="annot"><span class="annottext">brackets :: Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#brackets"><span class="hs-identifier hs-var hs-var">brackets</span></a></span></span><span> </span><span id="local-6989586621679050032"><span class="annot"><span class="annottext">Doc
</span><a href="#local-6989586621679050032"><span class="hs-identifier hs-var">p</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'['</span></span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Doc
</span><a href="#local-6989586621679050032"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">']'</span></span><span>
</span><span id="line-248"></span><span id="braces"><span class="annot"><span class="annottext">braces :: Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#braces"><span class="hs-identifier hs-var hs-var">braces</span></a></span></span><span> </span><span id="local-6989586621679050031"><span class="annot"><span class="annottext">Doc
</span><a href="#local-6989586621679050031"><span class="hs-identifier hs-var">p</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'{'</span></span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Doc
</span><a href="#local-6989586621679050031"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'}'</span></span><span>
</span><span id="line-249"></span><span>
</span><span id="line-250"></span><span class="hs-comment">-- | Apply 'parens' to 'Doc' if boolean is true.</span><span>
</span><span id="line-251"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#maybeParens"><span class="hs-identifier hs-type">maybeParens</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-252"></span><span id="maybeParens"><span class="annot"><span class="annottext">maybeParens :: Bool -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#maybeParens"><span class="hs-identifier hs-var hs-var">maybeParens</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-253"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#maybeParens"><span class="hs-identifier hs-var">maybeParens</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span>
</span><span id="line-254"></span><span>
</span><span id="line-255"></span><span class="hs-comment">-- | Apply 'brackets' to 'Doc' if boolean is true.</span><span>
</span><span id="line-256"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#maybeBrackets"><span class="hs-identifier hs-type">maybeBrackets</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-257"></span><span id="maybeBrackets"><span class="annot"><span class="annottext">maybeBrackets :: Bool -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#maybeBrackets"><span class="hs-identifier hs-var hs-var">maybeBrackets</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-258"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#maybeBrackets"><span class="hs-identifier hs-var">maybeBrackets</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#brackets"><span class="hs-identifier hs-var">brackets</span></a></span><span>
</span><span id="line-259"></span><span>
</span><span id="line-260"></span><span class="hs-comment">-- | Apply 'braces' to 'Doc' if boolean is true.</span><span>
</span><span id="line-261"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#maybeBraces"><span class="hs-identifier hs-type">maybeBraces</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-262"></span><span id="maybeBraces"><span class="annot"><span class="annottext">maybeBraces :: Bool -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#maybeBraces"><span class="hs-identifier hs-var hs-var">maybeBraces</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-263"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#maybeBraces"><span class="hs-identifier hs-var">maybeBraces</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#braces"><span class="hs-identifier hs-var">braces</span></a></span><span>
</span><span id="line-264"></span><span>
</span><span id="line-265"></span><span class="hs-comment">-- | Apply 'quotes' to 'Doc' if boolean is true.</span><span>
</span><span id="line-266"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#maybeQuotes"><span class="hs-identifier hs-type">maybeQuotes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-267"></span><span id="maybeQuotes"><span class="annot"><span class="annottext">maybeQuotes :: Bool -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#maybeQuotes"><span class="hs-identifier hs-var hs-var">maybeQuotes</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-268"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#maybeQuotes"><span class="hs-identifier hs-var">maybeQuotes</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span>
</span><span id="line-269"></span><span>
</span><span id="line-270"></span><span class="hs-comment">-- | Apply 'doubleQuotes' to 'Doc' if boolean is true.</span><span>
</span><span id="line-271"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#maybeDoubleQuotes"><span class="hs-identifier hs-type">maybeDoubleQuotes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-272"></span><span id="maybeDoubleQuotes"><span class="annot"><span class="annottext">maybeDoubleQuotes :: Bool -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#maybeDoubleQuotes"><span class="hs-identifier hs-var hs-var">maybeDoubleQuotes</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-273"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#maybeDoubleQuotes"><span class="hs-identifier hs-var">maybeDoubleQuotes</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#doubleQuotes"><span class="hs-identifier hs-var">doubleQuotes</span></a></span><span>
</span><span id="line-274"></span><span>
</span><span id="line-275"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-276"></span><span class="hs-comment">-- Structural operations on GDocs</span><span>
</span><span id="line-277"></span><span>
</span><span id="line-278"></span><span class="hs-comment">-- | Perform some simplification of a built up @GDoc@.</span><span>
</span><span id="line-279"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-type">reduceDoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span>
</span><span id="line-280"></span><span id="reduceDoc"><span class="annot"><span class="annottext">reduceDoc :: Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var hs-var">reduceDoc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span id="local-6989586621679050029"><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050029"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-var">Doc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc () -&gt; Doc ()
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">Ann.reduceDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050029"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-281"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#reduceDoc"><span class="hs-pragma hs-type">reduceDoc</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-282"></span><span>
</span><span id="line-283"></span><span class="hs-comment">-- | List version of '&lt;&gt;'.</span><span>
</span><span id="line-284"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#hcat"><span class="hs-identifier hs-type">hcat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-285"></span><span id="hcat"><span class="annot"><span class="annottext">hcat :: [Doc] -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#hcat"><span class="hs-identifier hs-var hs-var">hcat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Doc ()] -&gt; Doc ()) -&gt; [Doc] -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#liftList"><span class="hs-identifier hs-var">liftList</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc ()] -&gt; Doc ()
forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#hcat"><span class="hs-identifier hs-var">Ann.hcat</span></a></span><span>
</span><span id="line-286"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#hcat"><span class="hs-pragma hs-type">hcat</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-287"></span><span>
</span><span id="line-288"></span><span class="hs-comment">-- | List version of '&lt;+&gt;'.</span><span>
</span><span id="line-289"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#hsep"><span class="hs-identifier hs-type">hsep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-290"></span><span id="hsep"><span class="annot"><span class="annottext">hsep :: [Doc] -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#hsep"><span class="hs-identifier hs-var hs-var">hsep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Doc ()] -&gt; Doc ()) -&gt; [Doc] -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#liftList"><span class="hs-identifier hs-var">liftList</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc ()] -&gt; Doc ()
forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#hsep"><span class="hs-identifier hs-var">Ann.hsep</span></a></span><span>
</span><span id="line-291"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#hsep"><span class="hs-pragma hs-type">hsep</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-292"></span><span>
</span><span id="line-293"></span><span class="hs-comment">-- | List version of '$$'.</span><span>
</span><span id="line-294"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#vcat"><span class="hs-identifier hs-type">vcat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-295"></span><span id="vcat"><span class="annot"><span class="annottext">vcat :: [Doc] -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#vcat"><span class="hs-identifier hs-var hs-var">vcat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Doc ()] -&gt; Doc ()) -&gt; [Doc] -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#liftList"><span class="hs-identifier hs-var">liftList</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc ()] -&gt; Doc ()
forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#vcat"><span class="hs-identifier hs-var">Ann.vcat</span></a></span><span>
</span><span id="line-296"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#vcat"><span class="hs-pragma hs-type">vcat</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-297"></span><span>
</span><span id="line-298"></span><span class="hs-comment">-- | Nest (or indent) a document by a given number of positions</span><span>
</span><span id="line-299"></span><span class="hs-comment">-- (which may also be negative).  'nest' satisfies the laws:</span><span>
</span><span id="line-300"></span><span class="hs-comment">--</span><span>
</span><span id="line-301"></span><span class="hs-comment">-- * @'nest' 0 x = x@</span><span>
</span><span id="line-302"></span><span class="hs-comment">--</span><span>
</span><span id="line-303"></span><span class="hs-comment">-- * @'nest' k ('nest' k' x) = 'nest' (k+k') x@</span><span>
</span><span id="line-304"></span><span class="hs-comment">--</span><span>
</span><span id="line-305"></span><span class="hs-comment">-- * @'nest' k (x '&lt;&gt;' y) = 'nest' k x '&lt;&gt;' 'nest' k y@</span><span>
</span><span id="line-306"></span><span class="hs-comment">--</span><span>
</span><span id="line-307"></span><span class="hs-comment">-- * @'nest' k (x '$$' y) = 'nest' k x '$$' 'nest' k y@</span><span>
</span><span id="line-308"></span><span class="hs-comment">--</span><span>
</span><span id="line-309"></span><span class="hs-comment">-- * @'nest' k 'empty' = 'empty'@</span><span>
</span><span id="line-310"></span><span class="hs-comment">--</span><span>
</span><span id="line-311"></span><span class="hs-comment">-- * @x '&lt;&gt;' 'nest' k y = x '&lt;&gt;' y@, if @x@ non-empty</span><span>
</span><span id="line-312"></span><span class="hs-comment">--</span><span>
</span><span id="line-313"></span><span class="hs-comment">-- The side condition on the last law is needed because</span><span>
</span><span id="line-314"></span><span class="hs-comment">-- 'empty' is a left identity for '&lt;&gt;'.</span><span>
</span><span id="line-315"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#nest"><span class="hs-identifier hs-type">nest</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-316"></span><span id="nest"><span class="annot"><span class="annottext">nest :: Int -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#nest"><span class="hs-identifier hs-var hs-var">nest</span></a></span></span><span> </span><span id="local-6989586621679050024"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679050024"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span id="local-6989586621679050023"><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050023"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-var">Doc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Doc () -&gt; Doc ()
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nest"><span class="hs-identifier hs-var">Ann.nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679050024"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050023"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-317"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#nest"><span class="hs-pragma hs-type">nest</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-318"></span><span>
</span><span id="line-319"></span><span class="hs-comment">-- | @hang d1 n d2 = sep [d1, nest n d2]@</span><span>
</span><span id="line-320"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#hang"><span class="hs-identifier hs-type">hang</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-321"></span><span id="hang"><span class="annot"><span class="annottext">hang :: Doc -&gt; Int -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#hang"><span class="hs-identifier hs-var hs-var">hang</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span id="local-6989586621679050021"><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050021"><span class="hs-identifier hs-var">d1</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679050020"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679050020"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span id="local-6989586621679050019"><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050019"><span class="hs-identifier hs-var">d2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-var">Doc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc () -&gt; Int -&gt; Doc () -&gt; Doc ()
forall a. Doc a -&gt; Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#hang"><span class="hs-identifier hs-var">Ann.hang</span></a></span><span> </span><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050021"><span class="hs-identifier hs-var">d1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679050020"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050019"><span class="hs-identifier hs-var">d2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-322"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#hang"><span class="hs-pragma hs-type">hang</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-323"></span><span>
</span><span id="line-324"></span><span class="hs-comment">-- | @punctuate p [d1, ... dn] = [d1 \&lt;&gt; p, d2 \&lt;&gt; p, ... dn-1 \&lt;&gt; p, dn]@</span><span>
</span><span id="line-325"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#punctuate"><span class="hs-identifier hs-type">punctuate</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-326"></span><span id="punctuate"><span class="annot"><span class="annottext">punctuate :: Doc -&gt; [Doc] -&gt; [Doc]
</span><a href="Text.PrettyPrint.HughesPJ.html#punctuate"><span class="hs-identifier hs-var hs-var">punctuate</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span id="local-6989586621679050017"><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050017"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679050016"><span class="annot"><span class="annottext">[Doc]
</span><a href="#local-6989586621679050016"><span class="hs-identifier hs-var">ds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-var">Doc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050015"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679050015"><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050015"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; [Doc ()] -&gt; [Doc ()]
forall a. Doc a -&gt; [Doc a] -&gt; [Doc a]
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#punctuate"><span class="hs-identifier hs-var">Ann.punctuate</span></a></span><span> </span><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050017"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050013"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span id="local-6989586621679050013"><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679050013"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Doc]
</span><a href="#local-6989586621679050016"><span class="hs-identifier hs-var">ds</span></a></span><span> </span><span class="hs-special">]</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-327"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#punctuate"><span class="hs-pragma hs-type">punctuate</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-328"></span><span>
</span><span id="line-329"></span><span>
</span><span id="line-330"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-331"></span><span class="hs-comment">-- Vertical composition @$$@</span><span>
</span><span id="line-332"></span><span>
</span><span id="line-333"></span><span class="hs-comment">-- | Above, except that if the last line of the first argument stops</span><span>
</span><span id="line-334"></span><span class="hs-comment">-- at least one position before the first line of the second begins,</span><span>
</span><span id="line-335"></span><span class="hs-comment">-- these two lines are overlapped.  For example:</span><span>
</span><span id="line-336"></span><span class="hs-comment">--</span><span>
</span><span id="line-337"></span><span class="hs-comment">-- &gt;    text &quot;hi&quot; $$ nest 5 (text &quot;there&quot;)</span><span>
</span><span id="line-338"></span><span class="hs-comment">--</span><span>
</span><span id="line-339"></span><span class="hs-comment">-- lays out as</span><span>
</span><span id="line-340"></span><span class="hs-comment">--</span><span>
</span><span id="line-341"></span><span class="hs-comment">-- &gt;    hi   there</span><span>
</span><span id="line-342"></span><span class="hs-comment">--</span><span>
</span><span id="line-343"></span><span class="hs-comment">-- rather than</span><span>
</span><span id="line-344"></span><span class="hs-comment">--</span><span>
</span><span id="line-345"></span><span class="hs-comment">-- &gt;    hi</span><span>
</span><span id="line-346"></span><span class="hs-comment">-- &gt;         there</span><span>
</span><span id="line-347"></span><span class="hs-comment">--</span><span>
</span><span id="line-348"></span><span class="hs-comment">-- '$$' is associative, with identity 'empty', and also satisfies</span><span>
</span><span id="line-349"></span><span class="hs-comment">--</span><span>
</span><span id="line-350"></span><span class="hs-comment">-- * @(x '$$' y) '&lt;&gt;' z = x '$$' (y '&lt;&gt;' z)@, if @y@ non-empty.</span><span>
</span><span id="line-351"></span><span class="hs-comment">--</span><span>
</span><span id="line-352"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#%24%24"><span class="hs-operator hs-type">($$)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-353"></span><span id="%24%24"><span class="annot"><span class="annottext">$$ :: Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#%24%24"><span class="hs-operator hs-var hs-var">($$)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Doc () -&gt; Doc () -&gt; Doc ()) -&gt; Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#liftBinary"><span class="hs-identifier hs-var">liftBinary</span></a></span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; Doc () -&gt; Doc ()
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%24%24"><span class="hs-operator hs-var">(Ann.$$)</span></a></span><span>
</span><span id="line-354"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">$$</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-355"></span><span>
</span><span id="line-356"></span><span class="hs-comment">-- | Above, with no overlapping.</span><span>
</span><span id="line-357"></span><span class="hs-comment">-- '$+$' is associative, with identity 'empty'.</span><span>
</span><span id="line-358"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#%24%2B%24"><span class="hs-operator hs-type">($+$)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-359"></span><span id="%24%2B%24"><span class="annot"><span class="annottext">$+$ :: Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#%24%2B%24"><span class="hs-operator hs-var hs-var">($+$)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Doc () -&gt; Doc () -&gt; Doc ()) -&gt; Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#liftBinary"><span class="hs-identifier hs-var">liftBinary</span></a></span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; Doc () -&gt; Doc ()
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%24%2B%24"><span class="hs-operator hs-var">(Ann.$+$)</span></a></span><span>
</span><span id="line-360"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">$+$</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-361"></span><span>
</span><span id="line-362"></span><span>
</span><span id="line-363"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-364"></span><span class="hs-comment">-- Horizontal composition @&lt;&gt;@</span><span>
</span><span id="line-365"></span><span>
</span><span id="line-366"></span><span class="hs-comment">-- We intentionally avoid Data.Monoid.(&lt;&gt;) here due to interactions of</span><span>
</span><span id="line-367"></span><span class="hs-comment">-- Data.Monoid.(&lt;&gt;) and (&lt;+&gt;).  See</span><span>
</span><span id="line-368"></span><span class="hs-comment">-- http://www.haskell.org/pipermail/libraries/2011-November/017066.html</span><span>
</span><span id="line-369"></span><span>
</span><span id="line-370"></span><span class="hs-comment">-- | Beside.</span><span>
</span><span id="line-371"></span><span class="hs-comment">-- '&lt;&gt;' is associative, with identity 'empty'.</span><span>
</span><span id="line-372"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#%3C%3E"><span class="hs-operator hs-type">(&lt;&gt;)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-373"></span><span id="%3C%3E"><span class="annot"><span class="annottext">&lt;&gt; :: Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var hs-var">(&lt;&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Doc () -&gt; Doc () -&gt; Doc ()) -&gt; Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#liftBinary"><span class="hs-identifier hs-var">liftBinary</span></a></span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; Doc () -&gt; Doc ()
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">(Ann.&lt;&gt;)</span></a></span><span>
</span><span id="line-374"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&lt;&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-375"></span><span>
</span><span id="line-376"></span><span class="hs-comment">-- | Beside, separated by space, unless one of the arguments is 'empty'.</span><span>
</span><span id="line-377"></span><span class="hs-comment">-- '&lt;+&gt;' is associative, with identity 'empty'.</span><span>
</span><span id="line-378"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#%3C%2B%3E"><span class="hs-operator hs-type">(&lt;+&gt;)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-379"></span><span id="%3C%2B%3E"><span class="annot"><span class="annottext">&lt;+&gt; :: Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#%3C%2B%3E"><span class="hs-operator hs-var hs-var">(&lt;+&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Doc () -&gt; Doc () -&gt; Doc ()) -&gt; Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#liftBinary"><span class="hs-identifier hs-var">liftBinary</span></a></span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; Doc () -&gt; Doc ()
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%2B%3E"><span class="hs-operator hs-var">(Ann.&lt;+&gt;)</span></a></span><span>
</span><span id="line-380"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&lt;+&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-381"></span><span>
</span><span id="line-382"></span><span>
</span><span id="line-383"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-384"></span><span class="hs-comment">-- Separate, @sep@</span><span>
</span><span id="line-385"></span><span>
</span><span id="line-386"></span><span class="hs-comment">-- Specification: sep ps  = oneLiner (hsep ps)</span><span>
</span><span id="line-387"></span><span class="hs-comment">--                         `union`</span><span>
</span><span id="line-388"></span><span class="hs-comment">--                          vcat ps</span><span>
</span><span id="line-389"></span><span>
</span><span id="line-390"></span><span class="hs-comment">-- | Either 'hsep' or 'vcat'.</span><span>
</span><span id="line-391"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#sep"><span class="hs-identifier hs-type">sep</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-392"></span><span id="sep"><span class="annot"><span class="annottext">sep :: [Doc] -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#sep"><span class="hs-identifier hs-var hs-var">sep</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Doc ()] -&gt; Doc ()) -&gt; [Doc] -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#liftList"><span class="hs-identifier hs-var">liftList</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc ()] -&gt; Doc ()
forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep"><span class="hs-identifier hs-var">Ann.sep</span></a></span><span>
</span><span id="line-393"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#sep"><span class="hs-pragma hs-type">sep</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-394"></span><span>
</span><span id="line-395"></span><span class="hs-comment">-- | Either 'hcat' or 'vcat'.</span><span>
</span><span id="line-396"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#cat"><span class="hs-identifier hs-type">cat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-397"></span><span id="cat"><span class="annot"><span class="annottext">cat :: [Doc] -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#cat"><span class="hs-identifier hs-var hs-var">cat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Doc ()] -&gt; Doc ()) -&gt; [Doc] -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#liftList"><span class="hs-identifier hs-var">liftList</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc ()] -&gt; Doc ()
forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#cat"><span class="hs-identifier hs-var">Ann.cat</span></a></span><span>
</span><span id="line-398"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#cat"><span class="hs-pragma hs-type">cat</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-399"></span><span>
</span><span id="line-400"></span><span>
</span><span id="line-401"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-402"></span><span class="hs-comment">-- @fill@</span><span>
</span><span id="line-403"></span><span>
</span><span id="line-404"></span><span class="hs-comment">-- | \&quot;Paragraph fill\&quot; version of 'cat'.</span><span>
</span><span id="line-405"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#fcat"><span class="hs-identifier hs-type">fcat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-406"></span><span id="fcat"><span class="annot"><span class="annottext">fcat :: [Doc] -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#fcat"><span class="hs-identifier hs-var hs-var">fcat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Doc ()] -&gt; Doc ()) -&gt; [Doc] -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#liftList"><span class="hs-identifier hs-var">liftList</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc ()] -&gt; Doc ()
forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fcat"><span class="hs-identifier hs-var">Ann.fcat</span></a></span><span>
</span><span id="line-407"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#fcat"><span class="hs-pragma hs-type">fcat</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-408"></span><span>
</span><span id="line-409"></span><span class="hs-comment">-- | \&quot;Paragraph fill\&quot; version of 'sep'.</span><span>
</span><span id="line-410"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#fsep"><span class="hs-identifier hs-type">fsep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-411"></span><span id="fsep"><span class="annot"><span class="annottext">fsep :: [Doc] -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#fsep"><span class="hs-identifier hs-var hs-var">fsep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Doc ()] -&gt; Doc ()) -&gt; [Doc] -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#liftList"><span class="hs-identifier hs-var">liftList</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc ()] -&gt; Doc ()
forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fsep"><span class="hs-identifier hs-var">Ann.fsep</span></a></span><span>
</span><span id="line-412"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#fsep"><span class="hs-pragma hs-type">fsep</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-413"></span><span>
</span><span id="line-414"></span><span>
</span><span id="line-415"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-416"></span><span class="hs-comment">-- Selecting the best layout</span><span>
</span><span id="line-417"></span><span>
</span><span id="line-418"></span><span class="hs-comment">-- | @first@ returns its first argument if it is non-empty, otherwise its second.</span><span>
</span><span id="line-419"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#first"><span class="hs-identifier hs-type">first</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-420"></span><span id="first"><span class="annot"><span class="annottext">first :: Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#first"><span class="hs-identifier hs-var hs-var">first</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Doc () -&gt; Doc () -&gt; Doc ()) -&gt; Doc -&gt; Doc -&gt; Doc
</span><a href="Text.PrettyPrint.HughesPJ.html#liftBinary"><span class="hs-identifier hs-var">liftBinary</span></a></span><span> </span><span class="annot"><span class="annottext">Doc () -&gt; Doc () -&gt; Doc ()
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#first"><span class="hs-identifier hs-var">Ann.first</span></a></span><span>
</span><span id="line-421"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#first"><span class="hs-pragma hs-type">first</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-422"></span><span>
</span><span id="line-423"></span><span>
</span><span id="line-424"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-425"></span><span class="hs-comment">-- Rendering</span><span>
</span><span id="line-426"></span><span>
</span><span id="line-427"></span><span class="hs-comment">-- | Render the @Doc@ to a String using the default @Style@ (see 'style').</span><span>
</span><span id="line-428"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#render"><span class="hs-identifier hs-type">render</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-429"></span><span id="render"><span class="annot"><span class="annottext">render :: Doc -&gt; String
</span><a href="Text.PrettyPrint.HughesPJ.html#render"><span class="hs-identifier hs-var hs-var">render</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mode
-&gt; Int
-&gt; Float
-&gt; (TextDetails -&gt; ShowS)
-&gt; String
-&gt; Doc
-&gt; String
forall a.
Mode -&gt; Int -&gt; Float -&gt; (TextDetails -&gt; a -&gt; a) -&gt; a -&gt; Doc -&gt; a
</span><a href="Text.PrettyPrint.HughesPJ.html#fullRender"><span class="hs-identifier hs-var">fullRender</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Mode
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mode"><span class="hs-identifier hs-var hs-var">mode</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lineLength"><span class="hs-identifier hs-var hs-var">lineLength</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Float
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ribbonsPerLine"><span class="hs-identifier hs-var hs-var">ribbonsPerLine</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-430"></span><span>                    </span><span class="annot"><span class="annottext">TextDetails -&gt; ShowS
</span><a href="Text.PrettyPrint.HughesPJ.html#txtPrinter"><span class="hs-identifier hs-var">txtPrinter</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-431"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#render"><span class="hs-pragma hs-type">render</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-432"></span><span>
</span><span id="line-433"></span><span class="hs-comment">-- | Render the @Doc@ to a String using the given @Style@.</span><span>
</span><span id="line-434"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#renderStyle"><span class="hs-identifier hs-type">renderStyle</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Style"><span class="hs-identifier hs-type">Style</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-435"></span><span id="renderStyle"><span class="annot"><span class="annottext">renderStyle :: Style -&gt; Doc -&gt; String
</span><a href="Text.PrettyPrint.HughesPJ.html#renderStyle"><span class="hs-identifier hs-var hs-var">renderStyle</span></a></span></span><span> </span><span id="local-6989586621679050003"><span class="annot"><span class="annottext">Style
</span><a href="#local-6989586621679050003"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mode
-&gt; Int
-&gt; Float
-&gt; (TextDetails -&gt; ShowS)
-&gt; String
-&gt; Doc
-&gt; String
forall a.
Mode -&gt; Int -&gt; Float -&gt; (TextDetails -&gt; a -&gt; a) -&gt; a -&gt; Doc -&gt; a
</span><a href="Text.PrettyPrint.HughesPJ.html#fullRender"><span class="hs-identifier hs-var">fullRender</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Mode
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mode"><span class="hs-identifier hs-var hs-var">mode</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="#local-6989586621679050003"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lineLength"><span class="hs-identifier hs-var hs-var">lineLength</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="#local-6989586621679050003"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Float
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ribbonsPerLine"><span class="hs-identifier hs-var hs-var">ribbonsPerLine</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="#local-6989586621679050003"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-436"></span><span>                </span><span class="annot"><span class="annottext">TextDetails -&gt; ShowS
</span><a href="Text.PrettyPrint.HughesPJ.html#txtPrinter"><span class="hs-identifier hs-var">txtPrinter</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-437"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#renderStyle"><span class="hs-pragma hs-type">renderStyle</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-438"></span><span>
</span><span id="line-439"></span><span class="hs-comment">-- | Default TextDetails printer.</span><span>
</span><span id="line-440"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#txtPrinter"><span class="hs-identifier hs-type">txtPrinter</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextDetails"><span class="hs-identifier hs-type">TextDetails</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-441"></span><span id="txtPrinter"><span class="annot"><span class="annottext">txtPrinter :: TextDetails -&gt; ShowS
</span><a href="Text.PrettyPrint.HughesPJ.html#txtPrinter"><span class="hs-identifier hs-var hs-var">txtPrinter</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Chr"><span class="hs-identifier hs-type">Chr</span></a></span><span> </span><span id="local-6989586621679050001"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679050001"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span>   </span><span id="local-6989586621679050000"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679050000"><span class="hs-identifier hs-var">s</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679050001"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Char -&gt; ShowS
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679050000"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-442"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#txtPrinter"><span class="hs-identifier hs-var">txtPrinter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Str"><span class="hs-identifier hs-type">Str</span></a></span><span> </span><span id="local-6989586621679049998"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679049998"><span class="hs-identifier hs-var">s1</span></a></span></span><span class="hs-special">)</span><span>  </span><span id="local-6989586621679049997"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679049997"><span class="hs-identifier hs-var">s2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679049998"><span class="hs-identifier hs-var">s1</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679049997"><span class="hs-identifier hs-var">s2</span></a></span><span>
</span><span id="line-443"></span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#txtPrinter"><span class="hs-identifier hs-var">txtPrinter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#PStr"><span class="hs-identifier hs-type">PStr</span></a></span><span> </span><span id="local-6989586621679049995"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679049995"><span class="hs-identifier hs-var">s1</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679049994"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679049994"><span class="hs-identifier hs-var">s2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679049995"><span class="hs-identifier hs-var">s1</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679049994"><span class="hs-identifier hs-var">s2</span></a></span><span>
</span><span id="line-444"></span><span>
</span><span id="line-445"></span><span class="hs-comment">-- | The general rendering interface. Please refer to the @Style@ and @Mode@</span><span>
</span><span id="line-446"></span><span class="hs-comment">-- types for a description of rendering mode, line length and ribbons.</span><span>
</span><span id="line-447"></span><span id="local-6989586621679050226"><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#fullRender"><span class="hs-identifier hs-type">fullRender</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Mode"><span class="hs-identifier hs-type">Mode</span></a></span><span>                     </span><span class="hs-comment">-- ^ Rendering mode.</span><span>
</span><span id="line-448"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>                      </span><span class="hs-comment">-- ^ Line length.</span><span>
</span><span id="line-449"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Float"><span class="hs-identifier hs-type">Float</span></a></span><span>                    </span><span class="hs-comment">-- ^ Ribbons per line.</span><span>
</span><span id="line-450"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextDetails"><span class="hs-identifier hs-type">TextDetails</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679050226"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679050226"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- ^ What to do with text.</span><span>
</span><span id="line-451"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679050226"><span class="hs-identifier hs-type">a</span></a></span><span>                        </span><span class="hs-comment">-- ^ What to do at the end.</span><span>
</span><span id="line-452"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>                      </span><span class="hs-comment">-- ^ The document.</span><span>
</span><span id="line-453"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679050226"><span class="hs-identifier hs-type">a</span></a></span></span><span>                        </span><span class="hs-comment">-- ^ Result.</span><span>
</span><span id="line-454"></span><span id="fullRender"><span class="annot"><span class="annottext">fullRender :: forall a.
Mode -&gt; Int -&gt; Float -&gt; (TextDetails -&gt; a -&gt; a) -&gt; a -&gt; Doc -&gt; a
</span><a href="Text.PrettyPrint.HughesPJ.html#fullRender"><span class="hs-identifier hs-var hs-var">fullRender</span></a></span></span><span> </span><span id="local-6989586621679049993"><span class="annot"><span class="annottext">Mode
</span><a href="#local-6989586621679049993"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679049992"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679049992"><span class="hs-identifier hs-var">lineLen</span></a></span></span><span> </span><span id="local-6989586621679049991"><span class="annot"><span class="annottext">Float
</span><a href="#local-6989586621679049991"><span class="hs-identifier hs-var">ribbons</span></a></span></span><span> </span><span id="local-6989586621679049990"><span class="annot"><span class="annottext">TextDetails -&gt; a -&gt; a
</span><a href="#local-6989586621679049990"><span class="hs-identifier hs-var">txt</span></a></span></span><span> </span><span id="local-6989586621679049989"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679049989"><span class="hs-identifier hs-var">rest</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span id="local-6989586621679049988"><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679049988"><span class="hs-identifier hs-var">doc</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-455"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mode -&gt; Int -&gt; Float -&gt; (TextDetails -&gt; a -&gt; a) -&gt; a -&gt; Doc () -&gt; a
forall a b.
Mode -&gt; Int -&gt; Float -&gt; (TextDetails -&gt; a -&gt; a) -&gt; a -&gt; Doc b -&gt; a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fullRender"><span class="hs-identifier hs-var">Ann.fullRender</span></a></span><span> </span><span class="annot"><span class="annottext">Mode
</span><a href="#local-6989586621679049993"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679049992"><span class="hs-identifier hs-var">lineLen</span></a></span><span> </span><span class="annot"><span class="annottext">Float
</span><a href="#local-6989586621679049991"><span class="hs-identifier hs-var">ribbons</span></a></span><span> </span><span class="annot"><span class="annottext">TextDetails -&gt; a -&gt; a
</span><a href="#local-6989586621679049990"><span class="hs-identifier hs-var">txt</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679049989"><span class="hs-identifier hs-var">rest</span></a></span><span> </span><span class="annot"><span class="annottext">Doc ()
</span><a href="#local-6989586621679049988"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-456"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.HughesPJ.html#fullRender"><span class="hs-pragma hs-type">fullRender</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-457"></span><span>
</span><span id="line-458"></span></pre></body></html>